import pic from '@/assets/imgs/fileTypeLogo/pic.png'
import doc from '@/assets/imgs/fileTypeLogo/word.png'
import pdf from '@/assets/imgs/fileTypeLogo/pdf.png'
import ppt from '@/assets/imgs/fileTypeLogo/ppt.png'
import xls from '@/assets/imgs/fileTypeLogo/xls.png'
import zip from '@/assets/imgs/fileTypeLogo/zip.png'
import txt from '@/assets/imgs/fileTypeLogo/txt.png'
import unknow from '@/assets/imgs/fileTypeLogo/unknow.png'

export const staticData = () => {
  // 项目流程信息配置
  const processConfig = {
    "项目移交": [
      { task: '项目交底人审批', role: 'accepter' },
      { task: '三级经理审批', role: 'thirdManager' },
      { task: '交付经理审批', role: 'manager' }
    ],
    "项目定级": [
      { task: '交付经理审批', role: 'projectManager' },
      { task: '建设单位部门经理审批', role: 'constructionDepartmentManager' }
    ],
    "团队组建": [
      { task: '交付经理审批', role: 'projectManager' }
    ],
    "项目开工": [
      { task: '交付经理审批', role: 'projectManager' },
      { task: '建设单位部门经理审批', role: 'constructionDepartmentManager' },
      { task: '省端项目主管审批', role: 'projectSupervisor' }
    ],
    "实施进度": [
      { task: '交付经理审批', role: 'projectManager' },
      { task: '建设单位部门经理审批', role: 'constructionDepartmentManager' }
    ],
    "试运行": [
      { task: '交付经理审批', role: 'projectManager' },
      { task: '建设单位部门经理审批', role: 'constructionDepartmentManager' }
    ],
    "项目交付": [
      { task: '交付经理审批', role: 'projectManager' },
      { task: '服务经理审批', role: 'maintenanceManager' },
      { task: '建设单位部门经理审批', role: 'constructionDepartmentManager' },
      { task: '省端项目主管审批', role: 'projectSupervisor' },
      { task: 'ICT系统审批', role: 'ICTSystem' },
      { task: '交付经理审核', role: 'projectManagerSecond' },
      { task: '政企运维平台审批', role: 'operationSystem' }
    ],
    "项目审计": [
      { task: '项目经理审批', role: 'projectManager' }
    ],
    "后评估": [
      { task: '交付经理审批', role: 'projectManager' }
    ]
  };
  const stageList = [
    '项目移交',
    '项目定级',
    '团队组建',
    '项目开工',
    '实施进度',
    '试运行',
    '项目交付',
    // '项目审计',
    '后评估',
    '已结束'
  ]
  const stepList = [
    {
      name: '项目移交'
    },
    {
      name: '项目定级'
    },
    {
      name: '团队组建'
    },
    {
      name: '项目开工'
    },
    {
      name: '实施进度'
    },
    {
      name: '试运行'
    },
    {
      name: '项目交付'
    },
    // {
    //   name: '项目审计'
    // },
    {
      name: '后评估'
    }
  ]
  // 审批状态映射
  const approvalStatusObj = {
    0: '待审批',
    1: '审批中',
    2: '审批通过',
    3: '审批不通过',
    4: '已取消',
    5: '已退回',
    6: '委派中',
    7: '审批通过中'
  }
  // 审批节点颜色映射
  const approvalFontColor = {
    0: '#fafafa',
    1: '#3f9eff',
    2: '#67c23a',
    3: '#f56c6c',
    4: '#909399',
    5: '#e6a23c',
    6: '#796400',
    7: '#fc5531'
  }
  // 文件图标映射
  const fileIconObj = {
    "doc": doc,
    "docx": doc,
    "ppt": ppt,
    "pptx": ppt,
    "xls": xls,
    "xlsx": xls,
    "pdf": pdf,
    "jpg": pic,
    "jpeg": pic,
    "png": pic,
    "zip": zip,
    "rar": zip,
    "7z": zip,
    "txt": txt,
    "unknow": unknow
  }
  // 可预览文件类型
  // const previewableTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'txt', 'pdf', 'jpg', 'jpeg', 'png']
  const previewableTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf', 'jpg', 'jpeg', 'png']

  const regionCodeMap = {
    "省公司": 1,
    "西安分公司": 2,
    "铜川分公司": 3,
    "咸阳分公司": 4,
    "宝鸡分公司": 5,
    "渭南分公司": 6,
    "汉中分公司": 7,
    "安康分公司": 8,
    "商洛分公司": 9,
    "榆林分公司": 10,
    "延安分公司": 11,
  };

  const roleCodeMap = {
    superAdmin: 1,
    accepter: 2,
    thirdManager: 3,
    constructionDepartmentManager: 3,
    manager: 4,
    projectManager: 4,
    maintenanceManager: 5,
    projectSupervisor: 6,
  };

  // 项目交付阶段文件-建设+运维/纯建设
  const constructionProjectFiles = {
    "项目移交": [],
    "项目定级": [
      {
        file_type: "自主集成证明材料",
        required: false
      },
      {
        file_type: "自主研发证明材料",
        required: false
      },
      {
        file_type: "自主运维证明材料",
        required: false
      },
      {
        file_type: "自主交付证明材料",
        required: false
      }
    ],
    "团队组建": [
      {
        file_type: "项目启动会会议纪要",
        required: true
      },
      {
        file_type: "客户对接沟通文件",
        required: false
      }
    ],
    "项目开工": [
      {
        file_type: "开工报告",
        required: true
      },
      {
        file_type: "实施计划",
        required: true
      }
    ],
    "实施进度": [
      {
        file_type: "例会会议纪要",
        required: true
      },
      {
        file_type: "项目进度报告",
        required: true,
      }
    ],
    "试运行": [
      {
        file_type: "项目试运行报告",
        required: true
      },
      {
        file_type: "试运行问题收集表",
        required: false
      },
      {
        file_type: "试运行问题处理登记表",
        required: false
      }
    ],
    "项目交付": [
      {
        file_type: "交付证明",
        required: true,
        remark: "仅支持500KB以下JPG/PNG格式图片",
        format: ['jpg', 'png'],
        sizeLimit: 500
      },
      {
        file_type: "项目到货签收单",
        required: false
      },
      {
        file_type: "软件开发日志",
        required: false
      },
      {
        file_type: "软件安装交付报告",
        required: false
      },
      {
        file_type: "项目验收报告",
        required: true
      },
      {
        file_type: "项目终验报告",
        required: true
      },
      {
        file_type: "交付现场报告",
        required: true
      },
      {
        file_type: "软件产品文档",
        required: false
      },
      {
        file_type: "项目运维报告",
        required: false,
        remark: "含运维内容且系统流程提交时间晚于实际交付时间必传"
      },
      {
        file_type: "项目技术文档",
        required: false,
        remark: "未上传软件产品文档则本项必传"
      },
      {
        file_type: "交维验收清单",
        required: true
      },
      {
        file_type: "项目交维验收确认单",
        required: true
      },
      {
        file_type: "其他交付文件",
        required: false,
        remark: "限制不超过50个文件",
        file_limit: 50
      }
    ],
    "后评估": [],
    "其他": []
  };

  const constructionProjectShowFiles ={
    ...constructionProjectFiles,
    "其他": []
  }
  // 项目交付阶段文件-纯运维
  const maintenanceProjectFiles = {
    "项目移交": [],
    "项目定级": [],
    "团队组建": [],
    "项目开工": [
      {
        file_type: "开工报告",
        required: true
      }
    ],
    "实施进度": [],
    "试运行": [],
    "项目交付": [
      {
        file_type: "交付证明",
        required: true,
        remark: "仅支持500KB以下JPG/PNG格式图片",
        format: ['jpg', 'png'],
        sizeLimit: 500
      },
      {
        file_type: "项目运维报告",
        required: true
      }
    ],
    "后评估": [],
    "其他": []
  };

  const maintenanceProjectShowFiles ={
    ...maintenanceProjectFiles,
    "其他": []
  }

  // 映射对象
  const autonomousTypeMap = {
    '1': '自主集成',
    '2': '自主研发',
    '3': '自主运维',
    '4': '自主交付',
    '5': '基础管理'
  };

  return {
    processConfig,
    stageList,
    stepList,
    approvalStatusObj,
    approvalFontColor,
    fileIconObj,
    previewableTypes,
    regionCodeMap,
    roleCodeMap,
    // projectFiles,
    // projectShowFiles,
    constructionProjectFiles,
    constructionProjectShowFiles,
    maintenanceProjectFiles,
    maintenanceProjectShowFiles,
    autonomousTypeMap
  }
}